a service that queries the resource (contact) object using filters for security controls, region/practice/group, skills, utilization, and others. Queries can be set to return resources that do not exactly match the filter criteria (fuzzy matching). When fuzzy matching is enabled, depending on a specified preference resources may be returned that do not match the region, practice, and group filters. Certain additionalContactFilters can also be set to fuzzy match when fuzzy matching is enabled. (Currently the only additionalContactFilter that can be set to be fuzzy is resource role.) The level of preference for these filters can be defined by weightings in the Resource Search Service custom settings. The priority of weightings is Essential (must match), Ideal, Desirable, then Suggested. When using fuzzy matching the returned resources are ordered so that the best matching resources occur first. This order supersedes any requested order specified by the filter's orderByFields. A good match is determined firstly by how well the filter criteria match, then by the overall skill ratings, and finally the availability.
global static List<Contact> execute(ResourceSearchService.ResourceSearchFilter filter)
The execute method searches for resources that meet the supplied criteria. Note if the search criteria use encrypted fields, the results cannot be sorted or filtered and an error displays.
An instance of the ResourceSearchService.ResourceSearchFilter class that supplies the search criteria.
Return Value
Returns a list of Contact records with the requested fields and skills, and optionally additional utilization related fields.
Sample Code
//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.
You need to provide some sample code
refines search results using filters defined in resourcesearchfilterfield. filter values are <field><operator><value> or <field><operator><values> with soql operators valid for the field type and an appropriate value or values for the field type. When fuzzy matching is enabled and the filter is defined to be fuzzy, non-matching values can be returned from the SOQL query and weighted according to the user's preference. If the user preference indicates "Essential" then an exact match is performed.
refines search results using related lists consisting of the related object, relationship field (the resource (contact) object), the field to search containing the relevant id, and the id.
a list of lists containing sets of skills. each "skill set" (inner list) is an and operation, while each member of the "skill set" (inner list) are "or" operations.
applyStaffingPermissionControls
Boolean
if set to true, then staffing permission controls are factored into the results and returns only resources the user has staffing permissions for.
resourceIds
Set<Id>
a set of resource ids by which the search should be limited.
disableSharingModel
Boolean
if set to true, the api will bypass the sharing model.
disableSecurityOnReturnedData
Boolean
if set to true, then crud and field-level security (fls) are applied to returned data fields. If set to false (default) an error is thrown if the user does not have the required permissions.
disableSecurityOnSearchCriteria
Boolean
if set to true, then crud and field-level security (fls) are disabled for data fields used to filter results. If set to false (default) an error is thrown if the user does not have the required permissions.
regionFilter
ID
searches for resource records in a region. note that you cannot use this property in conjunction with regionsfilter.
regionsFilter
Set<ID>
searches for resource records in a set of regions. note that you cannot use this property in conjunction with regionfilter.
includeSubregions
Boolean
includes sub-regions included under the region(s) searched.
practiceFilter
ID
searches for resource records in a practice. note that you cannot use this property in conjunction with practicesfilter.
practicesFilter
Set<ID>
searches for resource records in a set of practices. note that you cannot use this property in conjunction with practicefilter.
includeSubpractices
Boolean
includes sub-practices included under the practice searched.
groupFilter
ID
searches for resource records in a group. note that you cannot use this property in conjunction with groupsfilter.
groupsFilter
Set<ID>
searches for resource records in a set of groups. note that you cannot use this property in conjunction with groupfilter.
includeSubgroups
Boolean
includes sub-groups included under the group searched.
utilizationStartDate
Date
specifies the start date for when you need the resource.
utilizationEndDate
Date
specifies the end date for when you need the resource.
utilizationIncludeBillableAssignments
Boolean
set to false to exclude billable assignments from the resource search. by default, this value is true.
utilizationIncludeCreditedAssignments
Boolean
set to false to exclude credited assignments from the resource search. by default, this value is true.
utilizationIncludeExcludedAssignments
Boolean
set to false to exclude excluded assignments from the resource search. by default, this value is true.
utilizationIncludeNonBillableAssignments
Boolean
set to false to exclude non-billable assignments from the resource search. by default, this value is true.
utilizationIncludeHeldResourceRequests
Boolean
set to false to exclude held resource requests from the resource search. by default, this value is true.
utilizationMinimumHoursAvailable
Decimal
specifies a numeric value specifying the minimum number hours. note that you cannot use this property in conjunction with the utilizationNoMinimumAvailabilityRequirements global variable.
utilizationMinimumAvailability
Decimal
specifies percentage of minimum availability. note that you cannot use this property in conjunction with the utilizationNoMinimumAvailabilityRequirements global variable.
utilizationAppliedConjunctionAnd
Boolean
by default, if both utilizationminimumhoursavailable and utilizationminimumavailability are supplied then both conditions must be met. Set this value to false to retrieve resources that meet either condition. Note that you cannot use this property in conjunction with the utilizationNoMinimumAvailabilityRequirements global variable.
utilizationNoMinimumAvailabilityRequirements
Boolean
by default, you must supply either the utilizationminimumhoursavailable or the utilizationminimumavailability global variable to generate utilization data. Set this value to true to generate utilization data for all matching resources. Note that you cannot use this property in conjunction with the utilizationMinimumAvailability, utilizationMinimumAvailability, or utilizationAppliedConjunctionAnd global variables.
retrieve assignments that are assigned to the resource.
isAssigned
Boolean
when this variable is set to true, the api uses (data_assigned__c fields = true) to query the utilization_engine_tod__c and returns the resources with assignments in the requested time frame global variable.
isCalendared
Boolean
when this variable is set to true, the api uses (data_calendar__c fields = true) to query the utilization_engine_tod__c and returns the calendared resources who have working hours in the requested time frame global variable.
isHeld
Boolean
when this variable is set to true, the api uses (data_held__c fields = true) to query the utilization_engine_tod__c and returns resources that have held resource request in the requested time frame global variable.
startTimeOfDay
DateTime
specifies the start time of the day when you need the resource
endTimeOfDay
DateTime
specifies the end time of the day when you need the resource
Defines a skill rating to be used in conjunction with skills filters.
Properties
Name
Type
Description
skillID
ID
the id of the skill for which to search
rating
String
the minimum skill rating required to qualify as a match. if null, matches are based on skill without evaluating specific ratings.
alternativeRatingField
sObjectField
the field from the skill_certification_rating__c on which to search ratings. If null, the Rating__c field is used.
matchGreaterThanRatings
Boolean
includes skill ratings greater than the specified rating. when false, searches for specified ratings must match the exact rating. Note that you cannot use this property in conjunction with operator or a null rating.
operator
String
defines the operator. must contain an appropriate value for the field (see the Salesforce SOQL Documentation for more about soql comparison operators). Note that you cannot use this property in conjunction with matchGreaterThanRatings or a null rating. If the rating is 'None', then the only valid operators are '=' (equal) or '!=' (not equal).